import { fetchWithAuth, fetchWrapper } from './common';
import type { ResDataType } from './common';

interface UserInfoRes extends ResDataType {
	permissions: string[];
	user: {
		userId: string;
		nickName: string;
	};
}

export const getUserInfo = () => {
	return fetchWithAuth<UserInfoRes>('/system/user/wechat/getInfo');
};

interface DictItem {
	dictLabel: string;
	dictValue: string;
	remark: string;
}
export const getDictApi = ([url]: string[]) => {
	return fetchWrapper<DictItem[]>(url);
};

